package demo.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import demo.model.tUser;
import demo.service.commonService;

@RestController
public class commonController {
	
	@Resource
    private commonService service;
	
	@RequestMapping("/")
	public ModelAndView index(Model model){
		return new ModelAndView("index");
	}
	
	@RequestMapping("/users")
	public List<tUser> getByGradeNm(){
        return service.users();
    }
	
	@RequestMapping("/testUsers")
	public List<tUser> testUsers(){
		return service.testUsers();
    }
	
}
